<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>大奔农庄</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>    
    <link rel="stylesheet" href="../../css/swiper.min.css">
    <link rel="stylesheet" href="../../font/iconfont.css">
    
</head>
<body>
	<div class="aui-content">
		<div class="pingjia-textarea">
			<textarea class="aui-font-size-14" placeholder="宝贝满足你的期待吗？说说你的心得，分享给想买的人吧！" name="content" id="content"></textarea>
		</div>
	</div>
	<div class="aui-content-padded">
		 <p><div class="aui-btn aui-btn-block aui-btn-success aui-btn-sm" onclick="doPingjia();">确认发表</div></p>
	 </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script>
var db_key = 'user',myParam,db_user,useParam={};
apiready = function(){
	getuser();//获取用户信息
	myParam = api.pageParam;//获取参数
	
    useParam.rtk = RSapi.myrtk;
    useParam.mytoken = db_user.mytoken;
}
//获取用户储存在本地的数据
function getuser() {
    db_user = $api.getStorage(db_key);
}
//订单操作
function doPingjia() {
    useParam.oid = myParam.oid;//订单id

    var pj_content = document.getElementById("content").value;
    if(pj_content == ''){
    	alert('请输入评价内容！'); return;
    }
    useParam.content = pj_content;

    api.ajax({
        url: RSapi.base+RSapi.OrderDoComment,
        method: 'post',
        cache: false,
        timeout: 30,
        dataType: 'json',
        data: { values: useParam },
    }, function(ret, err){ 
        if (err) { 
            api.alert({msg:err.msg});
        }else{
        	api.alert({msg:ret.info});
        	//发送事件
	    	api.sendEvent({
                name: 'order_list_change',
                extra: {}
            });
			api.closeWin();
        }
    });
}
</script>
</html>



